<?php
namespace App\Http\Controllers;

use App\Http\Library\UserAuth;
use App\Http\Response\ApiResponse;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;

/**
 * Api基类
 * Class ApiController
 * @package App\Common\Controllers
 */
class ApiController extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    /**
     * 登陆用户
     * @var null|UserAuth
     */
    protected null|UserAuth $auth = null;

    /**
     * 当前请求
     * @var Request|null
     */
    protected ?Request $request = null;

    public function __construct(Request $request, UserAuth $userAuth)
    {
        $this->request = $request;
        $this->auth = $userAuth;
    }

    public function response(): ApiResponse
    {
        return new ApiResponse();
    }
}
